package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.AfoneCategory;
import com.example.demo.entity.GoodsAttributeCategory;
import com.example.demo.mapper.GoodsAttributeCategoryMapper;
import com.example.demo.service.IGoodsAttributeCategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr.Xiayh
 * @since 2024-06-17
 */
@Service
public class GoodsAttributeCategoryServiceImpl extends ServiceImpl<GoodsAttributeCategoryMapper, GoodsAttributeCategory> implements IGoodsAttributeCategoryService {
    @Resource
    private GoodsAttributeCategoryMapper goodsAttributeCategoryMapper;
    @Resource
    private AfoneCategoryServiceImpl afoneCategoryService;

    @Override
    public List<GoodsAttributeCategory> findAttribute(Map<String,Object> map) {
        QueryWrapper<GoodsAttributeCategory> queryWrapper = new QueryWrapper<>();
        String name = (String) map.get("notName");
        Integer parentId = (Integer) map.get("parentId");
        queryWrapper.eq("parentId", parentId)
                .eq("notName", name);
        return goodsAttributeCategoryMapper.selectList(queryWrapper);
    }
}
